package cn.jly.entity;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

import java.util.Date;
import java.util.List;

/**
 * @PackageName cn.jly.entity
 * @ClassName User
 * @Description user实体类
 * @Author 姬岚洋
 * @Date 2021/1/11 上午 11:25
 */
@XStreamAlias("user")
public class User {
    @XStreamAsAttribute
    @XStreamAlias("id")
    private Long id;

    @XStreamAsAttribute
    @XStreamAlias("username")
    private String username;

    @XStreamAsAttribute
    @XStreamAlias("birth")
    private Date birth;

    @XStreamAlias("appearance")
    private Appearance appearance;

    /**
     * xml中忽略list标签
     */
    @XStreamImplicit
    private List<Data> datas;

    public User() {
    }

    public User(Long id, String username, Date birth, Appearance appearance, List<Data> datas) {
        this.id = id;
        this.appearance = appearance;
        this.username = username;
        this.datas = datas;
        this.birth = birth;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Appearance getAppearance() {
        return appearance;
    }

    public void setAppearance(Appearance appearance) {
        this.appearance = appearance;
    }

    public List<Data> getDatas() {
        return datas;
    }

    public void setDatas(List<Data> datas) {
        this.datas = datas;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", appearance=" + appearance +
                ", datas=" + datas +
                '}';
    }
}

